package com.guoxin.chapter3.waitnotify.valueobject;

/**
 * @author guoxin
 * @date 2019年8月22日
 */
public class Run {
	public static void main(String[] args) throws InterruptedException {
		Object lock = new Object();
		Add add = new Add(lock);
		Subtract subtract = new Subtract(lock);
		ThreadSubtract ts1 = new ThreadSubtract(subtract);
		ts1.setName("s1");
		ts1.start();
		
		ThreadSubtract ts2 = new ThreadSubtract(subtract);
		ts2.setName("s2");
		ts2.start();
		
		Thread.sleep(1000);
		ThreadAdd ta = new ThreadAdd(add);
		ta.setName("a");
		ta.start();
	}
}
